package com.ffcs.test.redis;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author 天真热
 * @create 2024-02-19 19:42
 * @desc
 **/
@Service
public class RedisService {

    @Cacheable(value = "space", key = "'key'", sync = true)
    public String getdata() {
        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return sf.format(new Date());
    }

}





